package org.example.back.entity.user;

import java.time.LocalDateTime;

public class UserSport {
    private Integer id;
    private Integer userId;
    private String sportType;         // 运动类型
    private LocalDateTime startTime;  // 开始时间
    private LocalDateTime endTime;    // 结束时间
    private Double intensity;         // 强度(1,2,3,4,5)
    private String note;              // 备注
    private Double calories;          // 消耗热量

    // ===== Getter 和 Setter 方法 =====

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getSportType() {
        return sportType;
    }

    public void setSportType(String sportType) {
        this.sportType = sportType;
    }

    public LocalDateTime getStartTime() {
        return startTime;
    }

    public void setStartTime(LocalDateTime startTime) {
        this.startTime = startTime;
    }

    public LocalDateTime getEndTime() {
        return endTime;
    }

    public void setEndTime(LocalDateTime endTime) {
        this.endTime = endTime;
    }

    public Double getIntensity() {
        return intensity;
    }

    public void setIntensity(Double intensity) {
        this.intensity = intensity;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public Double getCalories() {
        return calories;
    }

    public void setCalories(Double calories) {
        this.calories = calories;
    }

    // ===== 用于大模型生成提示的文本 =====

    public String toLLMDescription() {
        StringBuilder sb = new StringBuilder();
        sb.append("请估算以下运动消耗的热量（单位：千卡）：\n");
        sb.append("类型：").append(sportType != null ? sportType : "未知").append("\n");
        sb.append("开始时间：").append(startTime != null ? startTime.toString() : "未知").append("\n");
        sb.append("结束时间：").append(endTime != null ? endTime.toString() : "未知").append("\n");
        sb.append("强度：").append(intensity != null ? intensity : "未知").append("\n");
        sb.append("备注：").append(note != null ? note : "无").append("\n");

        return sb.toString();
    }
}
